package com.jeesite.modules.rt.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.rt.entity.RtDevicePaoliang;
import com.jeesite.modules.rt.dao.RtDevicePaoliangDao;

/**
 * 跑量Service
 * @author 李寒冰
 * @version 2024-10-15
 */
@Service
public class RtDevicePaoliangService extends CrudService<RtDevicePaoliangDao, RtDevicePaoliang> {
	
	/**
	 * 获取单条数据
	 * @param rtDevicePaoliang
	 * @return
	 */
	@Override
	public RtDevicePaoliang get(RtDevicePaoliang rtDevicePaoliang) {
		return super.get(rtDevicePaoliang);
	}
	
	/**
	 * 查询分页数据
	 * @param rtDevicePaoliang 查询条件
	 * @param rtDevicePaoliang page 分页对象
	 * @return
	 */
	@Override
	public Page<RtDevicePaoliang> findPage(RtDevicePaoliang rtDevicePaoliang) {
		return super.findPage(rtDevicePaoliang);
	}
	
	/**
	 * 查询列表数据
	 * @param rtDevicePaoliang
	 * @return
	 */
	@Override
	public List<RtDevicePaoliang> findList(RtDevicePaoliang rtDevicePaoliang) {
		return super.findList(rtDevicePaoliang);
	}


	public RtDevicePaoliang getPaoliangBySnDate(String sn,String date){
		RtDevicePaoliang rtDevicePaoliang = new RtDevicePaoliang();
		rtDevicePaoliang.setSn(sn);
		rtDevicePaoliang.setWorkDateEq(date);
		List<RtDevicePaoliang> list = findList(rtDevicePaoliang);
		if(list != null && list.size() > 0){
			return list.get(0);
		}
		return null;
	}

	/**
	 * 保存数据（插入或更新）
	 * @param rtDevicePaoliang
	 */
	@Override
	@Transactional
	public void save(RtDevicePaoliang rtDevicePaoliang) {
		super.save(rtDevicePaoliang);
	}
	
	/**
	 * 更新状态
	 * @param rtDevicePaoliang
	 */
	@Override
	@Transactional
	public void updateStatus(RtDevicePaoliang rtDevicePaoliang) {
		super.updateStatus(rtDevicePaoliang);
	}
	
	/**
	 * 删除数据
	 * @param rtDevicePaoliang
	 */
	@Override
	@Transactional
	public void delete(RtDevicePaoliang rtDevicePaoliang) {
		super.delete(rtDevicePaoliang);
	}
	
}